package net.projecteuler.prob;

import java.util.List;

import net.projecteuler.util.PrimeUtil;

public class Problem46 implements Runnable{

	@Override
	public void run() {
		for(int i = 4; i < 1000000; i++){
			if(!(PrimeUtil.isPrime(i)) && i % 2 == 1){
				boolean bFound = false;
				for(int j = 0; j < i; j++){
					int diff = i - 2 * j * j;
					if(diff <= 0)
						break;
					
					if(PrimeUtil.isPrime(diff)){
						bFound = true;
						break;
					}
				}
				
				if(!bFound)
					System.out.println(i);
			}
		}
	}

}
